#pragma once
#include <mmsystem.h>
#include <mmreg.h>
#include "xastruct.h"
class XAUDIOPACKET;
class CAudioWM  
{
public:
	CAudioWM();
	virtual ~CAudioWM();

public:

	HWND			hWindow;
	int				PacketSize;
	WAVEFORMATEX	m_waveformat;

public:
	void SetPacketSize(int nsize);
	
	HRESULT InitializeAudio( HWND hWnd );

	void FinalizeAudio( );

	XAUDIOINFO *GetPlayerInfo( );

	void ReleasePlayerInfo( XAUDIOINFO *pai );

	HRESULT InitializePlayer( XAUDIOINFO *pai );

	HRESULT StartPlayer( XAUDIOINFO *pai );

	HRESULT StopPlayer( XAUDIOINFO *pai );

	HRESULT PlayerGetVolume( XAUDIOINFO *pai, DWORD *vol );

	HRESULT PlayerSetVolume( XAUDIOINFO *pai, DWORD vol );

	HRESULT PlayerWritePacket( XAUDIOINFO *pai, XAUDIOPACKET *pkt );

	void FinalizePlayer( XAUDIOINFO *pai );

};